﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;

namespace MPMovieCatalog.Configuration.Sections
{
    public sealed class ConnectionSection : PropertySection
    {
        [ConfigurationProperty("host")]
        private PropertyElement m_host
        {
            get
            {
                PropertyElement host = (PropertyElement)base["host"];
                return host;
            }

            set
            {
                base["host"] = value;
            }
        }

        [ConfigurationProperty("port")]
        private PropertyElement m_port
        {
            get
            {
                PropertyElement port = (PropertyElement)base["port"];
                return port;
            }
            set
            {
                base["port"] = value;
            }
        }

        public string Host
        {
            get
            {
                return m_host.Value;
            }
            set
            {
                SetProperty("host", value);
            }
        }

        public decimal Port
        {
            get
            {
                return m_port.ValueAsLong;
            }
            set
            {
                SetProperty("port", value.ToString());
            }
        }
    }
}
